/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.longview.io.modules.grasstype.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import org.hibernate.validator.constraints.Length;

import com.longview.io.common.persistence.TreeEntity;

/**
 * 草地类型Entity
 * @author zf
 * @version 2018-04-16
 */
public class GrassType extends TreeEntity<GrassType> {
	
	private static final long serialVersionUID = 1L;
	private GrassType parent;		// parent_id
	private String parentIds;		// parent_ids
	private String name;		// 类型名称
	private Integer sort;		// 顺序
	private String ratio5;		// 5月系数
	private String ratio6;		// 6月系数
	private String ratio7;		// 7月系数
	private String ratio9;		// 8月系数
	private String ratio8;		// 9月系数
	private String ratio10;		// 10月系数
	private String remark;		// remark
	
	public GrassType() {
		super();
	}

	public GrassType(String id){
		super(id);
	}

	@JsonBackReference
	public GrassType getParent() {
		return parent;
	}

	public void setParent(GrassType parent) {
		this.parent = parent;
	}
	
	@Length(min=0, max=2000, message="parent_ids长度必须介于 0 和 2000 之间")
	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	
	@Length(min=0, max=100, message="类型名称长度必须介于 0 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	public String getRatio5() {
		return ratio5;
	}

	public void setRatio5(String ratio5) {
		this.ratio5 = ratio5;
	}
	
	public String getRatio6() {
		return ratio6;
	}

	public void setRatio6(String ratio6) {
		this.ratio6 = ratio6;
	}
	
	public String getRatio7() {
		return ratio7;
	}

	public void setRatio7(String ratio7) {
		this.ratio7 = ratio7;
	}
	
	public String getRatio9() {
		return ratio9;
	}

	public void setRatio9(String ratio9) {
		this.ratio9 = ratio9;
	}
	
	public String getRatio8() {
		return ratio8;
	}

	public void setRatio8(String ratio8) {
		this.ratio8 = ratio8;
	}
	
	public String getRatio10() {
		return ratio10;
	}

	public void setRatio10(String ratio10) {
		this.ratio10 = ratio10;
	}
	
	@Length(min=0, max=100, message="remark长度必须介于 0 和 100 之间")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public String getParentId() {
		return parent != null && parent.getId() != null ? parent.getId() : "0";
	}
}